﻿using System;
using System.Windows;
using System.Windows.Input;

namespace Oxage.CNC.Commands
{
	public class ApplicationCommand : ICommand
	{
		#region ICommand Members
		public bool CanExecute(object parameter)
		{
			return true;
		}

		public event EventHandler CanExecuteChanged;
		protected virtual void OnCanExecuteChanged()
		{
			if (CanExecuteChanged != null)
			{
				CanExecuteChanged(this, new EventArgs());
			}
		}

		public void Execute(object parameter)
		{
			var command = parameter as string;
			switch (command)
			{
				case "Exit":
					Application.Current.Shutdown(0);
					break;
			}
		}
		#endregion
	}
}
